// Playground - noun: a place where people can play

var courses = [76:"私人定制", 77:"CSS3", 78:"Play Swift"]
var website = ["搜索引擎":"Google","学习网站":"慕课网","新闻网站":"网易新闻"]


var courses2:Dictionary<Int,String> = [76:"私人定制", 77:"CSS3", 78:"Play Swift"]
var website2:Dictionary<String,String> = ["搜索引擎":"Google","学习网站":"慕课网","新闻网站":"网易新闻"]

var courses3:[Int:String] = [76:"私人定制", 77:"CSS3", 78:"Play Swift"]
var website3:[String:String] = ["搜索引擎":"Google","学习网站":"慕课网","新闻网站":"网易新闻"]

var dict = Dictionary<Int,String>()
var dict2 = [Int:String]()

website = Dictionary<String,String>()
website = [String:String]()

website = [:]

courses.count

courses.isEmpty

courses[76]
website2["学习网站"]

//Optional
courses[73]
website["学习网站"]

"课程名称:" + courses[76]!

courses[73] = "HAHA"
courses

courses[76] = "HEHE"
courses

var oldValue = courses.updateValue("WASAI", forKey: 76)
oldValue
courses

courses[73] = nil
courses

courses.removeValueForKey(76)
courses

for (key,value) in courses
{
    println("\(key) is \(value)")
}

courses.keys
courses.values

for key in courses.keys
{
    println(key)
}

for value in courses.values
{
    println(value)
}


Array( courses.keys )
[String]( courses.values )

let dict1 = [1:"A",2:"B",3:"C"]
let array1 = ["A","B","C"]

//dict1[1] = "AA"
//dict1[4] = "D"
//dict1[1] = nil

//array1.append("D")
//array1.removeAtIndex(0)
//array1[0] = "AA"













